#ifndef JMUTEX_P_H
#define JMUTEX_P_H

#include "jmutex.h"
#include <QMutex>

// - class JMutexPrivate -

/**
 * @brief The JMutexData class
 */
class JMutexPrivate
{
public:
    JMutexPrivate(JMutex::RecursionMode mode)
        : mutex((QMutex::RecursionMode)mode)
        , ref(0)
    {
    }

    JMutexPrivate(QMutex *mutex)
        : ref(mutex)
    {
    }

    QMutex mutex;
    QMutex *ref;
};

// - class JMutexLockerPrivate -

/**
 * @brief The JMutexLockerPrivate class
 */
class JMutexLockerPrivate
{
    friend class JMutexLocker;
public:
    JMutexLockerPrivate(JMutex *mutex)
        : locker(mutex->mutex())
    {

    }

private:
    QMutexLocker locker;
};

#endif // JMUTEX_P_H
